CREATE OR REPLACE PROCEDURE p_user_query
(
    o_ret    OUT NUMBER,
    o_cursor OUT pack_cursor.t_RetDataSet
) IS
BEGIN
    OPEN o_cursor FOR
        SELECT usernum,
               username,
               userpass,
               usersex,
               deparmentnum,
               userstats
        FROM   t_user;

    o_ret := 0;

EXCEPTION
    WHEN OTHERS THEN
        OPEN o_cursor FOR
            SELECT 1 FROM dual;
        o_ret := 1;
END p_user_query;
/
